<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用setPrototypeOf和getPrototypeOf替代__proto__</title>
</head>
<body>
    <script>
        let hd = {
            show(){
                console.log(this.name)
            }
        };

        let hdms = {name:"hdms"};
        Object.setPrototypeOf(hdms,hd);
        console.log(hdms);
        hdms.show();

        console.log(Object.getPrototypeOf(hdms));
    </script>
</body>
</html>